import "core-js/stable";
// import Cookies from "js-cookie";
import "regenerator-runtime/runtime";
import Vue from "vue";
// import AsyncComputed from 'vue-async-computed'
import "@/assets/icons";
import App from "./App.vue";
import router from "./router";
import store from "./store";
// import '@/plugins/element.js'
import * as ElementUI from "element-ui";
import init from "@/assets/elerem/index";
// import DicPPM from '@/components/dicppm-ui'
// Vue.component("dic-colorPicker", DicPPM['DicColorPicker']);

import formCreate from "@form-create/element-ui";
import "@/assets/iconfont/iconfont.css";
import Util from "@/plugins/util.js";
// import "xe-utils";
// import VXETable from "vxe-table";
// import "vxe-table/lib/style.css";
// TODO:ppmui
import PPMUI from "../../crm3.0part7-ppm/build/index.js";
// import PPMUI from "dic-crm3ppm-ui";
// Vue.use(AsyncComputed)
// Vue.use(VXETable);
// import '@/assets/elerem/styles/element-ui.css'
import "@/styles/element-variables.scss";
import "@/styles/index.scss"; // global css
// import 'amfe-flexible'
// import OrdersLoginService from "@/api/order/OrdersLoginService";
// allowRequest();
// async function allowRequest() {
// 	// const accept = await OrdersLoginService.acceptLoginUserInfo();
// 	const query = await OrdersLoginService.queryLoginUserInfo();
// 	// const process = await OrdersLoginService.processLoginUserInfo();
// 	if (query.code == 200) {
// 		const meta = query.meta;
// 		Cookies.set("order-userinfo", meta);
// 	}
// }
Vue.use(Util);
Vue.use(formCreate);
Vue.use(PPMUI);
Vue.config.productionTip = false;

const app = new Vue({
	router,
	store,
	render: (h) => h(App),
}).$mount("#app");

init(Vue, {
	elementToRem: true,
	config: {
		pxToRem: 100,
	},
	use: [ElementUI], // 组件批量注册

	prototype: {
		// vue原型方法设置
	},
});

const { queryParse } = app.$util;
let query = queryParse(window.location.href);
// 
app.$router.push({
	path: `/${query.router}`,
	query: { ...query },
});
